﻿using System;
using System.Data;
using System.Collections.Generic;

namespace DTcms.BLL
{
	/// <summary>
	/// 会员金额日志表
	/// </summary>
	public partial class user_amount_log
	{
        private readonly Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); //获得站点配置信息
        private readonly DAL.Mysql.user_amount_log dal;
		public user_amount_log()
		{
            dal = new DAL.Mysql.user_amount_log(siteConfig.sysdatabaseprefix);
        }

        #region 基本方法============================
        /// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int id)
		{
			return dal.Exists(id);
		}

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(int user_id, string user_name, decimal value, string remark)
        {
            Model.user_amount_log model = new Model.user_amount_log();
            model.user_id = user_id;
            model.user_name = user_name;
            model.value = value;
            model.remark = remark;
            return dal.Add(model);
        }

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(Model.user_amount_log model)
		{
			return dal.Add(model);
		}

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(Model.user_amount_log model)
		{
			return dal.Update(model);
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(int id)
		{
			return dal.Delete(id);
		}

        /// <summary>
        /// 根据用户名删除一条数据
        /// </summary>
        public bool Delete(int id, string user_name)
        {
            return dal.Delete(id, user_name);
        }

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public Model.user_amount_log GetModel(int id)
		{
			return dal.GetModel(id);
		}

		/// <summary>
		/// 获得前几行数据
		/// </summary>
		public DataSet GetList(int Top,string strWhere,string filedOrder)
		{
			return dal.GetList(Top,strWhere,filedOrder);
		}

        /// <summary>
        /// 获得查询分页数据
        /// </summary>
        public DataSet GetList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            return dal.GetList(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
        }
		#endregion
	}
}

